<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="得闲技术 Team">
    <meta name="copyright" content="得闲技术">
    <title>${modelMap.entityComment!}列表 - Powered By 得闲技术</title>
    [#include "/admin/main/resources/list.ftl"/]
</head>
<body class="admin secondary">
<main>
    <div class="container-fluid">
        [#assign activeBreadcrumb= "${modelMap.entityComment!}"/]
        [#include  "/admin/main/breadcrumb.ftl"/]
        <form action="list" method="get">
            <div id="filterModal" class="modal fade" tabindex="-1" style="display: none;">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button class="close" type="button" data-dismiss="modal">×</button>
                            <h5 class="modal-title">更多选项</h5>
                        </div>
                        <div class="modal-body form-horizontal">
                            [#include "/admin/main/resources/date_filter.ftl" /]
                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-primary" type="submit">确 定</button>
                            <button class="btn btn-default reset-all" type="button">重 置</button>
                            <button class="btn btn-default" type="button" data-dismiss="modal">取 消</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <div class="col-xs-12 col-sm-7">
                            <div class="btn-group">
                                [@hasPermission name="${modelMap.simpleClassName}:save" ]
                                <a class="btn btn-default" href="save" data-redirect-url="list">
                                    <i class="iconfont icon-add"></i>添加
                                </a>
                                [/@hasPermission]

                                [@hasPermission name="${modelMap.simpleClassName}:delete" ]
                                <button class="btn btn-default" type="button" data-action="delete" disabled>
                                    <i class="iconfont icon-close"></i>删除
                                </button>
                                [/@hasPermission]
                                <button class="btn btn-default" type="button" data-action="refresh">
                                    <i class="iconfont icon-refresh"></i>刷新
                                </button>
                                <button class="btn btn-default" type="button" data-toggle="modal"
                                        data-target="#filterModal">高级搜索
                                </button>
                                [#include "/admin/main/list/page_select.ftl" /]
                            </div>
                        </div>
                        <div class="col-xs-12 col-sm-5">
                            <div id="search" class="input-group">
                                <div class="input-group-btn">
                                    <button class="btn btn-default" type="button" data-toggle="dropdown">
                                        <#list modelMap.fields as field>
                                        <#if field_index==0>
                                            <span class="search-span">${field.comment!}</span>
                                        </#if>
                                        </#list>
                                <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <#list modelMap.fields as field>
                                    <li data-search-property="${field.name!}">
                                        <a href="javascript:;">${field.comment!}</a>
                                    </li>
                                    </#list>
                                </ul>
                            </div>
                            <input name="searchValue" class="form-control" type="text"
                                    value="${modelMap.dollar!}{form.searchValue}" placeholder="搜 索"
                                    x-webkit-speech="x-webkit-speech" x-webkit-grammar="builtin:search">
                            <div class="input-group-btn">
                                <button class="btn btn-default" type="submit">
                                    <i class="iconfont icon-search"></i>
                                    <span class="text-danger">[#if page??]${modelMap.dollar!}{page.total!0}[#else]0[/#if]</span>条 / <span class="text-danger">${modelMap.dollar!}{page.totalPages!0}</span>页</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel-body padding-10">
                <div class="table-responsive">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th>
                                <div class="checkbox">
                                    <input type="checkbox" data-toggle="checkAll">
                                    <label></label>
                                </div>
                            </th>
                            <#list modelMap.fields as field>
                            <th>
                                <a href="javascript:;" data-order-property="${field.name!}">
                                    ${field.comment!}
                                    <i class="iconfont icon-biaotou-kepaixu"></i>
                                </a>
                            </th>
                            </#list>
                        <th>
                            <a href="javascript:;" data-order-property="createDate">
                                创建时间
                                <i class="iconfont icon-biaotou-kepaixu"></i>
                            </a>
                        </th>
                        <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        [#list page.content as content]
                            <tr>
                                <td>
                                    <div class="checkbox">
                                        <input name="ids" type="checkbox"
                                                value="${modelMap.dollar}{content.id}"><label></label>
                                    </div>
                                </td>
                                <#list modelMap.fields as field>
                                <td>
                                    <#if field.bool>
                                    [#if content.${field.name}]
                                        <i class="text-green iconfont icon-check"></i>
                                    [#else]
                                        <i class="text-danger iconfont icon-close"></i>
                                    [/#if]
                                    <#else>
                                    ${modelMap.dollar!}{content.${field.name!}}
                                </#if>
                                </td>
                            </#list>
                            <td>
                                <span title="${modelMap.dollar!}{(content.createDate?string(" yyyy-MM-dd HH:mm:ss"))!}" data-toggle="tooltip">
                                    ${modelMap.dollar!}{(content.createDate?string("yyyy-MM-dd"))!}
                                </span>
                            </td>
                            <td>
                                [@hasPermission name="${modelMap.simpleClassName}:update" ]
                                <a class="btn btn-default btn-xs btn-icon"
                                        href="update?id=${modelMap.dollar!}{content.id}" data-redirect-url="list">
                                    <i class="iconfont icon-write"></i> 编辑
                                </a>
                                [/@hasPermission]
                            </td>
                            </tr>
                        [/#list]
                        </tbody>
                    </table>
                </div>
            </div>
            [@pagination pageNumber=page.pageNumber totalPages = page.totalPages]
                [#include "/admin/main/list/pagination.ftl" /]
            [/@pagination]
    </div>
    </form>
    </div>
</main>
</body>
</html>
